<%--
  Created by IntelliJ IDEA.
  User: Q倘若
  Date: 2021/2/10
  Time: 19:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>$Title$</title>
    <script src="${pageContext.request.contextPath}/statics/js/jquery-3.4.1.js"></script>
    <script>
        function go() {
            $.post({
                url: "${pageContext.request.contextPath}/a1",
                data: {"name": $("#username").val()},
                success: function (data,status) {
                    alert(data);
                    console.log("data:"+data);
                    console.log("status:"+status);
                },
                error: function () {

                }
            })
        }
    </script>
</head>
<body>
<%--失去焦点时，发起一个请求并携带信息到后台--%>
用户名：<input type="text" id="username" onblur="go()"/>
</body>
</html>
